/*
 * Singularity Engine
 * Copyright (C) 2010 Vyacheslav Vorobyov, All rights reserved.
 * See LICENSE for full license information.
 */

/**
 * 
 */
package org.singularity.mapred;

/**
 * This is a reduce element of a cascade. The purpose of 
 * this element is to fold joined data items arrived from 
 * several sources. The data items inflowing to such an 
 * element are designed to be a key-value pairs (vector 
 * stream) but the data items outflowing are values 
 * (scalar stream).
 * 
 * @param <KT> - a key type of inflowing key-value pairs.
 * @param <RT> - a result value type of outflowing items.
 * 
 * @author vjache
 * 
 * @see RedFun
 * @see MapFun
 * @see Source
 * @see Destination
 */
public interface ReduceElement<KT, RT> extends Source, Destination {
	/**
	 * Returns a reduce function.
	 * @see RedFun
	 */
	RedFun<KT, RT> getFun();
	/**
	 * 
	 * @param aFrom
	 * @param aMapFun
	 */
	void inflow(Source aFrom, MapFun<RT,KT, ?> aMapFun);
}
